#include <iostream>
using namespace std;

#include <vector>
#include <priority_queue>
class Solution {
public:
    int findKthLargest(vector<int>& nums, int k) {
        priority_queue<int> pq;
        for (int i = 0; i < nums.size(); i++)
            pq.push(nums[i]);

        while (--k)
        {
            pq.pop();
        }
        return pq.top();
    }
};